﻿<%@ Page Title="Solicitação de Certificados" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="SolicitacaoCertificado.aspx.cs" Inherits="AcadPosApp.ControlarMatricula.SolicitacaoCertificado" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style2
        {
            width: 303px;
        }
        .style3
        {
            width: 100%;
        }
        .style5
        {
        }
        .style12
        {
            width: 122px;
        }
        .style13
        {
            width: 176px;
        }
        .style14
        {
            height: 48px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consulta de Alunos">
        <table class="form-inline">
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label1" runat="server" Text="Estado"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlEstadoPesquisa" runat="server" OnSelectedIndexChanged="ddlEstadoPesquisa_SelectedIndexChanged"
                        AutoPostBack="True" Width="150px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label2" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtPesquisa" required pattern="[çÇùÙúÚôÔõÕòÒóÓìÌíÍêÊèÈéÉáÁàÀãÃâÂaA-zZ\s]+$"
                        title="Apenas Letras." runat="server" Width="300px" MaxLength="150"></asp:TextBox>
                </td>
                <td>
                    <br />
                    &nbsp;
                    <asp:Button ID="btnConsultar" runat="server" Text="Consultar" 
                        OnClick="btnConsultar_Click" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwPesquisa" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="mGrid" DataKeyNames="MATRICULA,CPF" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" Width="45%" OnSelectedIndexChanged="gvwPesquisa_SelectedIndexChanged"
            OnPageIndexChanging="gvwPesquisa_PageIndexChanging">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True" />
                <asp:BoundField DataField="MATRICULA" HeaderText="Matrícula">
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="NOME" HeaderText="Nome">
                    <ItemStyle HorizontalAlign="Left" Width="60%" />
                </asp:BoundField>
                <asp:BoundField DataField="ultima_solicitacao" HeaderText="Última Solic. Matrícula">
                    <ItemStyle HorizontalAlign="Left" Width="30%" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlMatriculasAluno" runat="server" GroupingText="Matrículas do Aluno"
        Visible="false">
        <asp:GridView ID="gvwMatriculasAluno" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="mGrid" 
            DataKeyNames="ID_MATRICULA,MATRICULA,ID_TURMA,DATA_CONCLUSAO_CURSO" EmptyDataText="Não há matrículas localizadas com o status de concluído..."
            GridLines="Vertical" OnPageIndexChanging="gvwMatriculasAluno_PageIndexChanging"
            Width="95%" 
            OnSelectedIndexChanged="gvwMatriculasAluno_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True" />
                <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="NOME_CURSO" HeaderText="Curso">
                    <HeaderStyle HorizontalAlign="Center" Width="30%" />
                    <ItemStyle HorizontalAlign="Left" Width="30%" />
                </asp:BoundField>
                <asp:BoundField DataField="CURRICULO" HeaderText="Currículo">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="NOME_MODULO" HeaderText="Módulo">
                    <HeaderStyle HorizontalAlign="Center" Width="30%" />
                    <ItemStyle HorizontalAlign="Left" Width="30%" />
                </asp:BoundField>
                <asp:BoundField DataField="COD_TURMA" HeaderText="Turma">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="ESTADO" HeaderText="Estado">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Left" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="NOME_POLO" HeaderText="Polo">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Left" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_MATRICULA" HeaderText="Dt.Matrícula">
                    <HeaderStyle HorizontalAlign="Center" Width="30%" />
                    <ItemStyle HorizontalAlign="Left" Width="30%" />
                </asp:BoundField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Left" Width="10%" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        &nbsp;&nbsp;&nbsp;&nbsp;<br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlSolicitacoes" runat="server" GroupingText="Solicitações Certificado"
        Visible="False">
        <asp:GridView ID="gvwSolicitacoes" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="mGrid" DataKeyNames="ID_SOLICITACAO" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" Width="95%" OnRowCommand="gvwSolicitacoes_RowCommand">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True" />
                <asp:BoundField DataField="VIA" HeaderText="Via">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_CERT_SOLICITADO" HeaderText="Data Solicitação">
                    <HeaderStyle HorizontalAlign="Center" Width="15%" />
                    <ItemStyle HorizontalAlign="Left" Width="15%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_CERT_ENTREGUE" HeaderText="Data Entrega Certificado">
                    <HeaderStyle HorizontalAlign="Center" Width="15%" />
                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_CONCLUSAO_CURSO" HeaderText="Data Conclusão Curso">
                    <HeaderStyle HorizontalAlign="Center" Width="15%" />
                    <ItemStyle HorizontalAlign="Left" Width="15%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_CERT_IMPRESSO" HeaderText="Data Expedição">
                    <HeaderStyle HorizontalAlign="Center" Width="15%" />
                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                </asp:BoundField>
                <asp:BoundField DataField="CHAVE_VALIDACAO" HeaderText="Chave Validação">
                    <HeaderStyle HorizontalAlign="Center" Width="30%" />
                    <ItemStyle HorizontalAlign="Left" Width="30%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Solicitação" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Impressão solicitação de certificado">
                            <asp:ImageButton ID="imgSolicitacao" runat="server" CausesValidation="false" CommandName="Solicitacao"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/print.png" Text="" Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Certificado" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Impressão certificado">
                            <asp:ImageButton ID="imgCertificado" runat="server" CausesValidation="false" CommandName="Certificado"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/print.png" Text="" Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <div class="legenda">
            &nbsp;&nbsp;
            <asp:Button ID="btnIncluir" runat="server" Text="Incluir" 
                OnClick="btnIncluir_Click" Width="100px" />
            <br />
            <br />
        </div>
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlIncluirSolicitacao" runat="server" GroupingText="Solicitação Certificado"
        Visible="False">
        <table class="style3">
            <tr>
                <td class="style13">
                    <asp:Label ID="Label3" runat="server" Text="Entrega Certificado"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtEntregaCertificado" required runat="server" Width="110px" MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtEntregaCertificado_CalendarExtender" runat="server"
                        Enabled="True" TargetControlID="TxtEntregaCertificado">
                    </asp:CalendarExtender>
                </td>
                <td class="style12">
                    <asp:Label ID="Label4" runat="server" Text="Conclusão Curso"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtConclusaoCurso" required runat="server" Width="110px" MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtConclusaoCurso_CalendarExtender" runat="server" Enabled="True"
                        TargetControlID="TxtConclusaoCurso">
                    </asp:CalendarExtender>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="3" class="style14">
                    <asp:Label ID="Label5" runat="server" Text="Título Trabalho de Conclusão do Curso"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtTituloTCC" runat="server" required Width="350px" MaxLength="255"></asp:TextBox>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label6" runat="server" Text="Professor Orientador"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtProfOrientador" required placeholder="Digite uma parte do nome"
                        runat="server" Width="350px" MaxLength="200"></asp:TextBox>
                    <asp:AutoCompleteExtender ID="TxtProfOrientador_AutoCompleteExtender" runat="server"
                        DelimiterCharacters="" Enabled="True" ServiceMethod="GetProfessores" MinimumPrefixLength="1"
                        EnableCaching="true" ServicePath="" TargetControlID="TxtProfOrientador" CompletionInterval="400">
                    </asp:AutoCompleteExtender>
                </td>
                <td>
                    <br />
                </td>
            </tr>
            <tr>
                <td class="style13">
                    <asp:Label ID="Label7" runat="server" Text="Nº Registro Ata"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtRegAta" required runat="server" Width="110px" MaxLength="10"></asp:TextBox>
                </td>
                <td class="style12">
                    <asp:Label ID="Label8" runat="server" Text="Número Livro"></asp:Label>
                    <asp:TextBox ID="TxtNumeroLivro" required pattern="[0-9]+$" title="Apenas números."
                        runat="server" Width="110px" MaxLength="6"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="Label9" runat="server" Text="Data Certificado Pronto"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDataCertificadoPronto" required runat="server" Width="110px"
                        MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtDataCertificadoPronto_CalendarExtender" runat="server"
                        Enabled="True" TargetControlID="TxtDataCertificadoPronto">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td class="style13">
                    <asp:Label ID="Label10" runat="server" Text="Número Folha"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtNumeroFolha" required pattern="[0-9]+$" title="Apenas números."
                        runat="server" Width="110px" MaxLength="6"></asp:TextBox>
                </td>
                <td class="style12">
                    <asp:Label ID="Label11" runat="server" Text="Carga Horária"></asp:Label>
                    <asp:TextBox ID="TxtCH" runat="server" required Width="110px" MaxLength="5"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="Label12" runat="server" Text="Data Entrega Certificado"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDataEntregaCertificado" required runat="server" Width="110px"
                        MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtDataEntregaCertificado_CalendarExtender" runat="server"
                        Enabled="True" TargetControlID="TxtDataEntregaCertificado">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td class="style5" colspan="3">
                    <br />
                    &nbsp;
                    <asp:Button ID="btnConfirmar" runat="server" OnClick="btnConfirmar_Click"
                        Text="Confirmar" ClientIDMode="Static" Width="100px" />
                    &nbsp;<asp:Button ID="btnCancelar" runat="server" formnovalidate="" 
                        OnClick="btnCancelar_Click" Text="Cancelar" Width="100px" />
                    <br />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
